<?php
	require("./conn.php");
	$username = $_POST['username1'];
	$password = $_POST['password1'];
	$sql = "select * from app_user where username = '$username'";
	$result = mysql_query($sql);
	$data = mysql_fetch_array($result);
	if($data['password'] == md5($password)){
		setcookie("username", "$username");
		setcookie("status", "login");
		header("Location:index.php?contect=登录成功");
	}else{
		setcookie("status", "no");
		header("Location:index.php?contect=用户名或密码不正确");
	}
?>